//
//  CIBNaController.m
//  CIBN
//
//  Created by ZNGOO on 16/7/18.
//  Copyright © 2016年 韦儒健. All rights reserved.
//

#import "CIBNaController.h"

@interface CIBNaController ()

@end

@implementation CIBNaController

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    // 1. 创建自定义导航
    [self createNavigation];
}


- (void)createNavigation{
    
    // 1. 导航
    self.navigationView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 64)];
    self.navigationView.backgroundColor = RGB(37, 43, 54);
    self.navigationView.userInteractionEnabled = YES;
    [self.view addSubview:self.navigationView];
    
    // 2. 左按钮
    self.leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(8, 22, 100, 40)];
    self.leftBtn.backgroundColor = [UIColor clearColor];
    [self.navigationView addSubview:self.leftBtn];
    
    // 3. 右按钮01
    self.rightBtn1 = [[UIButton alloc] initWithFrame:CGRectMake(ScreenWidth - 48, 22, 40, 40)];
    [self.rightBtn1 setImage:[UIImage imageNamed:@"time"] forState:UIControlStateNormal];
    [self.navigationView addSubview:self.rightBtn1];
    
    // 4. 右按钮01
    self.rightBtn2 = [[UIButton alloc] initWithFrame:CGRectMake(ScreenWidth - 88, 22, 40, 40)];
    [self.rightBtn2 setImage:[UIImage imageNamed:@"search"] forState:UIControlStateNormal];
    [self.navigationView addSubview:self.rightBtn2];
    
    
    // 5. 标题
    self.centerTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 40)];
    self.centerTitle.center = CGPointMake(CGRectGetWidth(self.navigationView.frame)/2, 42);
    self.centerTitle.text = @"测试";
    self.centerTitle.textAlignment = NSTextAlignmentCenter;
    self.centerTitle.textColor = [UIColor whiteColor];
    [self.navigationView addSubview:self.centerTitle];
}

// 设置状态栏白色
-(UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}
@end
